<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
  <head>
    <title>order</title>
  	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/back/css/bootstrap.min.css">
  	<script src="${pageContext.request.contextPath}/back/js/jquery-3.3.1.js"></script>
  	<script src="${pageContext.request.contextPath}/back/js/bootstrap.min.js"></script>
	<link rel="stylesheet" href="${pageContext.request.contextPath}/back/css/btn.css" />
    <meta name="keywords" content="keyword1,keyword2,keyword3">
    <meta name="description" content="this is my page">
    <meta name="content-type" content="text/html; charset=UTF-8">
    
  </head>
  <body style="background-color: #f0f9fd;">
  <div align=center style="font-size:25px">订单管理</div><hr/>
  	 <table bordercolor='#898E90' align='center' border='3px' cellpadding='10px' cellspacing="0px" width="950px">
          <tr bgcolor="lightblue" align="center"> 
              <td>订单id</td>
			  <td>订单编号</td>
			  <td>订单金额</td>
			  <td>订单状态</td>
              <td>收件人</td>
			  <td>收货地址</td>
			  <td>创建日期</td>
              <td>操作</td>
          </tr>

		 <c:forEach var="order" items="${requestScope.pageInfo.list}">
			 <tr align='center'>
				 <td>${order.orderId}</td>
				 <td>${order.orderNo}</td>
				 <td>${order.total}</td>
				 <td>${order.orderStatus}</td>
				 <td>${order.address.addressName}</td>
				 <td>${order.address.local}</td>
				 <td><fmt:formatDate value="${order.createDate}" pattern="yyyy-MM-dd"/></td>
				 <td>
					 <%----%>
					 <input class="button btn-order" onclick="location.href='${pageContext.request.contextPath}/order/showOrderDetail?orderId=${order.orderId}'" value="订单详细信息 &raquo;" />
				 </td>
			 </tr>
		 </c:forEach>
     </table>
  	<div align="center">
		<span style="font-size: 25px;margin: 5px">
			当前第${pageInfo.pageNum}页,共${pageInfo.pages}页,总${pageInfo.total}条记录
		</span>
	  <nav aria-label="Page navigation">
		  <ul class="pagination">
			  <li><a href="${pageContext.request.contextPath}/order/selectAllOrder?pageNum=1">首页</a></li>
			  <li>
				  <a href="${pageContext.request.contextPath}/order/selectAllOrder?pageNum=${pageInfo.prePage}" aria-label="Previous">
					  <span aria-hidden="true">&laquo;</span>
				  </a>
			  </li>
			  <c:forEach items="${pageInfo.navigatepageNums}" var="page_Num">
				  <c:if test="${page_Num==pageInfo.pageNum}">
					  <li class="active"><a href="${pageContext.request.contextPath}/order/selectAllOrder?pageNum=${page_Num}">${page_Num}</a></li>
				  </c:if>
				  <c:if test="${page_Num!=pageInfo.pageNum}">
					  <li><a href="${pageContext.request.contextPath}/order/selectAllOrder?pageNum=${page_Num}">${page_Num}</a></li>
				  </c:if>
			  </c:forEach>
			  <li>
				  <a href="${pageContext.request.contextPath}/order/selectAllOrder?pageNum=${pageInfo.pageNum+1}" aria-label="Next">
					  <span aria-hidden="true">&raquo;</span>
				  </a>
			  </li>
			  <li><a href="${pageContext.request.contextPath}/order/selectAllOrder?pageNum=${pageInfo.pages}">尾页</a></li>
		  </ul>
	  </nav>
  </div>
  </body>
</html>
